#include <bits/stdc++.h>

using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
using i128 = __int128;

const int N = 1e6 + 5;

void Solve() {
    return;
}

int main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    std::cout.tie(nullptr);
    int t;
    std::cin >> t;
    while (t--) {
        int n;
        std::cin >> n;
        std::set<int> s;
        for (int i = 0; i < n; i++) {
            int num;
            std::cin >> num;
            s.insert(num);
        }
        std::cout << s.size() << std::endl;
    }

    return 0;
}